package com.baijiaoxi.common.model.base;

public enum CommonError implements Error {

    setFieldValueByNameError(1, "对象属性设置异常"),
    illegalOrderQuerySql(2, "不支持的查询"),
    cacheNeedRedis(3, "默认缓存需先配置redis"),
    httpRequestFail(4, "请求失败"),
    loginErrorNoValidUserId(5, "登录失败，未找到有效的用户ID"),
    loginErrorWhenQuery(6, "登录失败，请求数据失败"),
    loginExpired(7, "登录状态已失效"),
    updateLoginErrorWhenQuery(8, "刷新登录失败，请求数据失败"),
    objectIsNull(9, "数据为空"),
    illegalEmailAddress(10, "邮箱地址%s不正确，请检查"),
    dataNotExistOrExpired(11, "数据不存在或已过期"),
    notSupport(12, "不支持的调用"),
    scanPackageError(13, "扫描包异常"),
    fileNotExist(14, "文件不存在"),
    encryptionFail(15, "加密失败"),
    decryptFail(16, "解密失败"),
    smsSendFail(17, "短信发送失败"),
    ossUploadError(18, "上传阿里云失败"),
    ossUploadErrorFileNotExists(19, "上传阿里云失败,文件不存在"),
    ossSignUrlError(20, "获取阿里云签名链接失败"),
    ossDelFileError(21, "阿里云删除文件失败"),
    cosUploadError(22, "上传腾讯云失败"),
    cosDelFileError(23, "腾讯云删除文件失败"),
    exportExcelFail(24, "导出失败"),
    closeOutAfterExportExcel(25, "导出结束，关闭文件失败"),
    closeSheetAfterExportExcel(26, "导出结束，关闭sheet失败"),
    getExportFieldValueFail(27, "获取导出字段值失败"),
    analyseSheetHeaderFail(28, "表头解析失败"),
    illegalExchangeHost(29, "exchange host 不合法"),
    unableCreateEmailByExchange(30, "无法创建exchange邮件"),
    invalidEmailConfig(31, "邮件配置无效"),
    unableSendEmailCauseServer(32, "邮件发送失败,请检查邮件服务器状态"),
    unableSendEmailCauseClient(33, "邮件发送失败，客户端异常"),
    unableSendEmailCauseOther(34, "邮件发送失败"),
    unableSendAllEmail(35, "邮件全部发送失败"),
    tooMuchJob(36, "异步任务过多，阻塞队列已满"),
    cannotParse(37, "类型无法转化"),
    noSuchField(38, "没有对应属性"),
    innerRequestSignFail(39, "内部请求签名创建失败"),
    innerRequestSignCheckFail(40, "内部请求签名检查失败"),
    ossSignUploadUrlFail(41, "获取阿里云签名上传链接失败"),
    objectReflectError(42, "反射调用失败"),
    ;

    private String msg;

    private int value;


    @Override
    public ErrorModule getModule() {
        return ErrorModule.common;
    }

    @Override
    public String msg() {
        return msg;
    }


    @Override
    public int value() {
        return value;
    }

    CommonError(int value, String msg) {
        this.value = getModule().getModuleCode() + value;
        this.msg = msg;
    }
}
